package com.leapp.sk.ui.activity.notify

import android.os.Bundle
import android.support.v4.widget.SwipeRefreshLayout
import com.example.mvp.activity.BaseActivityMVP
import com.example.mvp.binder.BaseDataBinder
import com.leapp.sk.R
import com.leapp.sk.bean.NotifyObjEntity
import com.leapp.sk.binder.BaseBinder
import com.leapp.sk.viewdelegate.notify.ExamineNotifyDelegate

/**
 * 审核通知
 * @author  chaohaipeng  on 2018/8/15.
 */
class ExamineNotifyActivit : BaseActivityMVP<ExamineNotifyDelegate>(), SwipeRefreshLayout.OnRefreshListener{
    override fun initView(p0: Bundle?) {
        viewDelegate.setTitle(resources.getString(R.string.string_notify_exmine_notify))
    }

    override fun initDate() {
        val mList= mutableListOf<NotifyObjEntity>()
        val notifyObjEntity1 = NotifyObjEntity()
        notifyObjEntity1.content="端午节放假，我园定于6月16...."
        notifyObjEntity1.creatTime=System.currentTimeMillis()
        notifyObjEntity1.typeName=resources.getString(R.string.string_notify_exmine_notify)
        val notifyObjEntity2 = NotifyObjEntity()
        notifyObjEntity2.content="家长协助宝贝完成小猪佩奇绘画"
        notifyObjEntity2.creatTime=System.currentTimeMillis()
        notifyObjEntity2.typeName=resources.getString(R.string.string_notify_exmine_notify)
        val notifyObjEntity3 = NotifyObjEntity()
        notifyObjEntity3.content="中医院来我园对3-5岁宝贝进行体检"
        notifyObjEntity3.creatTime=System.currentTimeMillis()
        notifyObjEntity3.typeName=resources.getString(R.string.string_notify_exmine_notify)
        val notifyObjEntity4 = NotifyObjEntity()
        notifyObjEntity4.content="客户端开启请假功能"
        notifyObjEntity4.creatTime=System.currentTimeMillis()
        notifyObjEntity4.typeName=resources.getString(R.string.string_notify_exmine_notify)
        mList.add(notifyObjEntity1)
        mList.add(notifyObjEntity2)
        mList.add(notifyObjEntity3)
        mList.add(notifyObjEntity4)
        viewDelegate.initAdapter(this,mList,this)
    }

    override fun bindEvenListener() {
    }

    override fun getDelegateClass(): Class<ExamineNotifyDelegate> {
        return ExamineNotifyDelegate::class.java
    }

    override fun getDataBinder(): BaseDataBinder<*, *> {
        return BaseBinder()
    }

    override fun onRefresh() {
        viewDelegate.stopSwipRefresh()
    }
}